var Detail={
	"status":false
	, "msg":"未获取到数据"
	, "url":""
};
var run_qrcode = function(tabid){
	chrome.tabs.get(tabid,function(tab){
		Detail.status=false;
		Detail.msg="未获取到数据";
		Detail.url="";
		var schema = tab.url.substr(0,4);
		if (schema=='http'){
			Detail.url=tab.url;
			Detail.status=true;
			Detail.msg="成功获取地址";
			chrome.pageAction.show(tab.id);
		} else {
			chrome.pageAction.hide(tab.id);
		}
	});
}

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab){
	run_qrcode(tabId)
});
chrome.tabs.onActivated.addListener(function(activateInfo){
	run_qrcode(activateInfo.tabId)
});
